##############################################################
##############################################################
### Replication Materials for
### Stefan Müller and Liam Kneafsey:
### Evidence for the Irrelevance of Irrelevant Events
### Political Science Research and Methods
###
### Please get in touch with the authors if you have any questions: 
### stefan.mueller@ucd.ie
### Note: 0000_readme.pdf contains 
### instructions and details about each script and dataset
##############################################################
##############################################################

## load required packages

library(knitr) # CRAN v1.31

## create log files

## We create log (=html) files that run all R scripts and 
## create the output as html files 
## to verify the reproducibility of the analysis.

## set working directory

setwd("")

## Procedure: script runs each R file and create html files
## that include the output from all analyses 
## (at times the plots are not formatted nicely, 
## but the plots are also provided in the correct format in
## the replication folder)

# now "spin" all results (runs the R scripts, produces the output files, 
# and saves code and output as an html file)
knitr::spin("01a_regressions_local_general.R")

knitr::spin("01b_unexpected_events_ines.R")

knitr::spin("02a_all_model_specifications_general.R")

knitr::spin("02b_all_model_specifications_local.R")

knitr::spin("02c_all_model_specifications_incumbent_party.R")

knitr::spin("03_equivalence_and_permutation_tests.R")

knitr::spin("04_analyse_issp.R")

knitr::spin("05_analyse_irish_voters.R")
